home *** CD-ROM | disk | FTP | other *** search
Wrap
function opening(a, b, c, d, e, f, g, h) { eval(a).org_x = eval(a)._x; eval(a).org_y = eval(a)._y; eval(a).org_yxcale = eval(a)._yscale; eval(a)._alpha = g; eval(a)._x += c; eval(a)._y += d; eval(a)._xscale = eval(a)._yscale = b; eval(a).step = f; eval(a).memo = h; eval(a).onEnterFrame = ZoomIn; } function ZoomIn() { this._x += (this.org_x - this._x) / this.step; this._y += (this.org_y - this._y) / this.step; this._alpha += (this.memo - this._alpha) / this.step; this._yscale += (this.org_yxcale - this._yscale) / this.step; this._xscale = this._yscale; this.step -= 1; if(this._x == this.org_x and this._y == this.org_y and this._alpha == this.memo) { this.onEnterFrame = null; delete this.onEnterFrame; } } function mouseeffect() { this._xscale += (this.scale - this._xscale) / 3; this._yscale = this._xscale; if(this._xscale < 101) { this._yscale = this._xscale = 100; this.onEnterFrame = null; delete this.onEnterFrame; } } function winner(who) { if(level != 5) { _root.winnerDisplay._visible = 1; opening("_root.winnerDisplay",10,0,0,0,30); _root.BG.Music.stop(); _root.BG.Music.setVolume(100); if(who == "com") { _root.game_over.start(0,1); _root.winnerDisplay.gotoAndStop(2); } else { _root.goal_sound.start(0,1); _root.winnerDisplay.gotoAndStop(1); } } else { stopAllSounds(); _parent.level = _parent.level + 1; _parent.gotoAndStop(_parent._currentframe - 1); } } function ShowLevel(lv) { com_pic.gotoAndStop(lv); if(lv == 5) { people_pic.gotoAndStop(2); } else { people_pic.gotoAndStop(1); } bg.gotoAndStop(lv); } function Check_act(who, whatup) { if(whatup == "win") { if(who == "com") { trace("xx"); ScoreDisplay.com_score = ScoreDisplay.com_score + 1; this.com_pic.obj.gotoAndStop(2); this.people_pic.obj.gotoAndStop(3); } else { ScoreDisplay.people_score = ScoreDisplay.people_score + 1; this.people_pic.obj.gotoAndStop(2); this.com_pic.obj.gotoAndStop(3); } } else if(who == "com") { ScoreDisplay.people_score = ScoreDisplay.people_score + 1; this.people_pic.obj.gotoAndStop(2); this.com_pic.obj.gotoAndStop(3); } else { ScoreDisplay.com_score = ScoreDisplay.com_score + 1; this.com_pic.obj.gotoAndStop(2); this.people_pic.obj.gotoAndStop(3); } if(ScoreDisplay.com_score >= 11 or ScoreDisplay.people_score >= 11) { if(Math.abs(ScoreDisplay.com_score - ScoreDisplay.people_score) >= 2) { if(ScoreDisplay.com_score > ScoreDisplay.people_score) { winner("com"); } else { winner("people"); } end = true; } } delete people.onEnterFrame; delete Com.onEnterFrame; delete this["ball" + (dept - 1)].onEnterFrame; clearInterval(Delay); Delay = setInterval(Sgame,1500); } function Sgame() { if(end != true) { people_pic.obj.gotoAndStop(1); com_pic.obj.gotoAndStop(1); Xmemo = 0; clearInterval(Delay); removeMovieClip("B"); removeMovieClip("Shadow"); people.onEnterFrame = Meffect; Com.onEnterFrame = Com_effect; Com._x = midd; com._x = 0; Toffset = 0; OldY = _ymouse; OldX = _xmouse; offset = 0; clearInterval(PowerCheck); PowerCheck = setInterval(GetPower,50); GetPower(); clearInterval(StartDelay); Check = false; if(Math.floor((Number(ScoreDisplay.com_score) + Number(ScoreDisplay.people_score)) / 5) % 2 == 1) { StartDelay = setInterval(Com_start,2000); } else { attachMovie("B_item","B",12); B._alpha = 50; B.onEnterFrame = Beffect; } } } function People_start() { clearInterval(StartDelay); removeMovieClip("B"); setup("ball" + dept,1,40,430,"startplayer",50,200,29,temps,"people",true); attachMovie("B_item","B",12); attachMovie("Shadow_item","Shadow",11); Shadow._visible = 0; } function Com_start() { clearInterval(StartDelay); removeMovieClip("B"); setup("ball" + dept,1.1,0,430,"start",50,-30,23 + random(5),temps,"com",true); attachMovie("B_item","B",12); attachMovie("Shadow_item","Shadow",11); Shadow._visible = 0; } function display(obj, item) { ZPos = 100 - int(wall._x / (mR - mL) * 100); trace(ZPos); this.attachMovie(obj,obj,100); Show3D(obj,item,ZPos,0,0); } function Show3D(obj, item, z, y, x) { Salce = SalceL[z + 22] / 350; this[obj]._x = midd - x * Salce; this[obj]._y = 20 + SalceL[z + 22] - y * Salce; this[obj]._xscale = this[obj]._yscale = 100 * Salce; } function Meffect() { Tmemo = (_root._ymouse - 180) * Scale + this._width / 2 + 260; this._x += (Tmemo - this._x) / 3; ZPos_x = 100 - int(people._x / (mR - mL) * 100); Tstart = ZPos_x; if(ZPos_x > 50) { ZPos_x = 49; } Player.item._rotation = 180 - Math.atan2(Player._x - maxB._x,Player._y - 450) * 180 / 3.141592653589793; Show3D("Player","Player",ZPos_x,10,midd - _xmouse); } function Beffect() { Xmemo = midd - _xmouse; if(Xmemo > 220) { Xmemo = 220; } if(Xmemo < -220) { Xmemo = -220; } Show3D("B","B",22,10,Xmemo); if(Tstart > 22 and B._alpha == 100) { delete this.onEnterFrame; Toffset = offset; People_start(); } if(Tstart < 5) { B._alpha = 100; } } function Com_effect() { ZPos_x = 100 - int(com._x / (mR - mL) * 100); Show3D("Com","Com",ZPos_x,10); if(B._x > 190 and B._x < 460) { this._x += (B._x - this._x) / ai[level][0]; } this.item._rotation = 180 - Math.atan2(this._x - maxB._x,this._y - 250) * 180 / 3.141592653589793; } function setup(Name, newdept, x, y, startobj, scale, rota, str, item, id, st) { Check = false; dept++; attachMovie(effect_list[item][0],Name,newdept); this[Name].item = item; this[Name].onEnterFrame = ball_act; this[Name]._xscale = this[Name]._yscale = 100; this[Name]._x = x; this[Name]._y = y; this[Name].lock = hittest; this[Name].角度 = rota; this[Name].力量 = str; this[Name].物件原位 = eval(Name)._y; this[Name].基本重力 = this[Name].重力 = effect_list[item][1]; this[Name].拋物線 = effect_list[item][2]; this[Name].角度a = this[Name].角度 * 0.017453292519943295; this[Name].x軸 = this[Name].力量 * Math.cos(this[Name].角度a); this[Name].y軸 = this[Name].力量 * Math.sin(this[Name].角度a) * -1; this[Name].firstrun = "no"; eval(Name)._visible = 0; this[Name].id = id; this[Name].Save = 0; this[Name].st = st; this[Name].startobj = startobj; } function ball_act() { if(this.fist == true) { Xmemo += Toffset; Xoffset = Xmemo; ZPos = 100 - int(this._x / (mR - mL) * 100); Show3D("B","B",ZPos,Depth - this._y,Xoffset); ZPos = 100 - int(this._x / (mR - mL) * 100); Show3D("Shadow","Shadow",ZPos,0,Xoffset); if(this._x > wall._x) { B.swapDepths(net.getDepth() + 1); } else { B.swapDepths(net.getDepth() - 1); } if(this._x > com._x) { Com.swapDepths(net.getDepth() - 2); } else { Com.swapDepths(net.getDepth() + 2); } } this.fist = true; if(this._x < wall._x) { if(Check == true) { if(this.Save == 1) { com._x += (this._x - com._x) / ai[level][0]; } } else if(this._x - com._x > 100) { com._x -= 10; } } else { com._x += (30 - com._x) / 10; } if(this.hitTest(wall)) { this._x -= this.x軸 * 2; Toffset = -0.4; this.x軸 *= -0.2; this.y軸 *= 0.7; if(this._x > wall._x) { this._x = wall._x + this._width; } else { this._x = wall._x - this._width; } } if(Ox + 100 > this._x and people._x < this._x and Check == true and Player.item.hit.hitTest(B) == true and this.id == "com") { if(this.Save == 1) { _root.Chit.start(0,1); checkpoint._x = this._x - 10; checkpoint._y = this._y; angle = 140 + 40 * (this._y - maxR._y) / (Player._y - maxR._y) + 10; Power2 = (this._x - wall._x) / 250; angle2 = (this._x - wall._x - 20) / 30 + 8; Toffset = offset; setup("ball" + dept,this.getDepth(),0,Depth,"checkpoint",100,angle - angle2,Number(effect_list[this.item][3]) + Power2 + Power,this.item,"people"); delete this.onEnterFrame; removeMovieClip(this._name); } } if(com._x + 100 > this._x and com._x < this._x and Check == true and Com.item.hit.hitTest(B) == true and this.id == "people") { if(this.Save >= 1) { _root.Phit.start(0,1); checkpoint._x = this._x + 10; checkpoint._y = this._y; angle = 40 * (this._y - maxR._y) / (Player._y - maxR._y); Power2 = (wall._x - this._x) / 290; angle2 = (wall._x - this._x + 20) / 30 - 14; KList = [1,-1]; offSetX = random(LevelList[level][0]) * LevelList[level][1] * KList[random(2)]; trace(offSetX + " " + LevelList[level][0] + LevelList[level][1]); if(offSetX > 0) { Toffset = offSetX * ((Com._x - 225) / 200); } else { Toffset = offSetX * ((Com._x - 425) * -1 / 200); } setup("ball" + dept,this.getDepth(),0,Depth,"checkpoint",100,angle - angle2,Number(effect_list[this.item][3]) + Power2 + random(6),this.item,"com"); delete this.onEnterFrame; removeMovieClip(this._name); } } if(this._y >= this.物件原位) { this._y = this.物件原位; this.重力 = this.基本重力; this.向上力 = 0; this.TimingReturn = false; this.Jumping = true; } else { this.Jumping = false; this.TimingReturn = false; if(this._y > this.物件原位 * this.拋物線) { this._y = this.物件原位; this.向上力 = 0; this.TimingReturn = true; } } if(this.Jumping) { if(this.firstrun == "no") { this._y = eval(this.startobj)._y - 10; this._x = eval(this.startobj)._x; this._visible = 1; this.firstrun = "yes"; } else { Shadow._visible = 1; if(this.y軸 > 0) { if(this.st == true) { this.Save--; } this.y軸 *= -1; } if(this.id == "com" and this._x < wall._x and this.Save > 0) { Check_act("people","win"); } if(this.id == "people" and this._x > wall._x and this.Save > 0) { Check_act("com","win"); } if(Shadow._y > maxB._y or Shadow._y < maxT._y or Xoffset > 240 or Xoffset < -240) { if(this.Save <= 3) { if(this.Save == 0) { Check_act(this.id,"lose"); _root.Pout.start(0,1); } else { Check_act(this.id,"win"); _root.Pout.start(0,1); } } } else { _root.BG.Music.setVolume(30); _root.SObj.S_hitTable.start(0,1); } this.Save = this.Save + 1; Check = true; if(this.Save > 3 and int(Math.abs(this.y軸) + Math.abs(this.x軸)) > 0 and Shadow._y < maxB._y and Shadow._y > maxT._y and Xoffset < 230 and Xoffset > -230) { if(this._x > wall._x) { Check_act("com","win"); } else { Check_act("people","win"); } } } this.y軸 *= 0.99; this.x軸 *= 0.99; this.向上力 = this.y軸; } if(!this.Jumping) { if(this._y < this.物件原位) { this.向上力 += this.重力 * speed_list[level]; this.重力 *= 1.0013; } } if(!this.TimingReturn) { this.Jumping = false; } this.x軸 *= 0.998; this.y軸 *= 0.998; this._x += this.x軸 * speed_list[level]; this._y += this.向上力 * speed_list[level]; } function GetPower() { offset = (OldX - _xmouse) / 5; Power = (OldY - _ymouse) / 10; OldX = _xmouse; OldY = _ymouse; Ox = people._x; } level = _root.level; LevelList = [[10,1],[12,1],[5,2],[6,2],[4,3],[6,2]]; end = false; Depth = 420; SalceL = []; STemp = 500; i = 1; while(i < 130) { SalceL[i] = STemp - 70; STemp *= 0.993111; i++; } ScoreDisplay.LevelDisplay = level; opening("people_pic",10,0,0,0,10); opening("com_pic",10,0,0,0,10); opening("ScoreDisplay",100,0,-100,0,20); opening("StartBtn",10,0,0,0,15); mR = maxR._x; mL = maxL._x; mT = maxT._y; mB = maxB._y; Yscale = mB - mT; Xscale = mR - mL; Scale = 3.4583333333333335; midd = 325; Player.swapDepths(999); display("net","wall"); ShowLevel(level); dept = 1; temps = 0; speed_list = [1,1.01,1.01,1.02,1.02,1.03]; ai = [[7,12],[7,12],[7,11],[7,11],[6,11],[5,10]]; effect_list = [["football",1.2,0.99,23,37]]; _root.winnerDisplay.swapDepths(1000); _root.winnerDisplay._visible = 0; stop(); StartBtn.swapDepths(99999); StartBtn.onPress = function() { clearInterval(Delay); Delay = setInterval(Sgame,1000); this._visible = 0; };